<?php echo form_open('', array('class' => 'form-horizontal'))?>
    <legend><?php echo isset($data) ? 'Sửa' : 'Thêm mới';?> danh mục</legend>
    <?php if (isset($error)):?>
        <div class="alert alert-error"><?php echo $error;?></div>
    <?php else :?>
        <?php if (isset($msg)):?><div class="alert alert-success"><?php echo $msg;?></div><?php endif;?>
    <?php endif;?>
    <div class="control-group">
        <label class="control-label" for="title">Tên danh mục</label>
        <div class="controls">
            <input type="text" class="input-xxlarge" name="title" id="title" value="<?php echo @$data['title'];?>" placeholder="Tên sản phẩm">
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="discount">Tỉ lệ giảm giá</label>
        <div class="controls">
            <input type="text" class="input-xxlarge numeric" name="discount" id="discount" value="<?php echo @$data['discount'];?>" placeholder="Tỉ lệ giảm giá sản phẩm">
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="category">Danh mục cha</label>
        <div class="controls">
            <?php echo form_dropdown('parent_id', @$category, @$data['parent_id'], 'class="input-xlarge"')?>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="quantity">Mô tả ngắn gọn</label>
        <div class="controls">
            <textarea name="intro" class="input-xxlarge" rows="5"><?php echo @$data['intro'];?></textarea>
        </div>
    </div>

    <div class="control-group">
        <div class="controls">
            <button type="submit" class="btn"><?php echo isset($data) ? 'Lưu sản phẩm' : 'Thêm mới sản phẩm';?></button>
        </div>
    </div>
</form>